home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-desktop-9.10-i386-PL.iso / casper / filesystem.squashfs / etc / init.d / screen-cleanup < prev    next >
Text File  |  2009-07-06  |  1KB  |  45 lines

  1. #!/bin/sh
  2. # $Id: init,v 1.3 2004/03/16 01:43:45 zal Exp $
  3. #
  4. # Script to remove stale screen named pipes on bootup.
  5. #
  6.  
  7. ### BEGIN INIT INFO
  8. # Provides:          screen-cleanup
  9. # Required-Start:    $remote_fs
  10. # Required-Stop:     $remote_fs
  11. # Default-Start:     S
  12. # Default-Stop:
  13. # Short-Description: screen sessions cleaning
  14. ### END INIT INFO
  15.  
  16. set -e
  17.  
  18. SCREENDIR=/var/run/screen
  19.  
  20. case "$1" in
  21. start)
  22.     if test -L $SCREENDIR || ! test -d $SCREENDIR; then
  23.         rm -f $SCREENDIR
  24.         mkdir $SCREENDIR
  25.         chown root:utmp $SCREENDIR
  26.     fi
  27.     find $SCREENDIR -type p -print0 | xargs -0r rm -f --
  28. # If the local admin has used dpkg-statoverride to install the screen
  29. # binary with different set[ug]id bits, change the permissions of
  30. # $SCREENDIR accordingly
  31.     BINARYPERM=`stat -c%a /usr/bin/screen`
  32.     if [ "$BINARYPERM" -ge 4000 ]; then
  33.         chmod 0755 $SCREENDIR
  34.     elif [ "$BINARYPERM" -ge 2000 ]; then
  35.         chmod 0775 $SCREENDIR
  36.     else
  37.         chmod 0777 $SCREENDIR
  38.     fi
  39.     ;;
  40. stop|restart|reload|force-reload)
  41.     ;;
  42. esac
  43.  
  44. exit 0
  45.